<?php

namespace App\Http\Controllers;

use App\Http\Controllers\Controller;
use App\Models\Page;
use Illuminate\Http\Request;
use App\Models\Index;

class PageController extends Controller
{

    public function index(Request $request)
    {
      
      if(request()->get('jp', 0) == 1 || session('jp') == 1)
      {
          \App::setLocale('jp');
          session(['jp' => '1']);

      }else{
        \App::setLocale('zh-CN');
        session(['jp' => 0]);
      }
        $info = Page::where('id', $request->id)->firstOrFail();
        return view('page.index', compact('info'));
    }


}
